package week1;

import java.util.Scanner;

public class T3 {
    public static void main(String[] args) {
        int j=1;
        Scanner scanner=new Scanner(System.in);
        String input1=scanner.nextLine();
        String[] data=input1.split(" ");
        int n=Integer.parseInt(data[0]);
        int target=Integer.parseInt(data[1]);


        Scanner scanner3=new Scanner(System.in);
        String input=scanner3.nextLine();
        String[] elements=input.split(" ");
        int[] array=new int[elements.length];
        for (int i=0;i<elements.length;i++){
            array[i]=Integer.parseInt(elements[i]);
        }




        //find
        int min=0;
        int max=array.length;
        int mid ;

        while (j!=0) {
            mid=(min+max)/2;
            if (array[mid]<target){
                min=mid+1;
            }
            else if (array[mid]>target){
                max=mid-1;
            }
            else {
                System.out.println(mid);
                break;
            }

            if (target>array[mid]&&target<array[mid+1]){
                System.out.println((mid+1));
                break;
            }
            else if (target<array[mid]&&target>array[mid-1]){
                System.out.println(mid);
                break;
            }
        }







    }
}